package com.fzz.dao;

import com.fzz.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface UserMapping {

    //登录
    @Select("select * from tb_user where username=#{username} and password=#{password}")
    public User userLogin(@Param("username") String username, @Param("password") String password);

    //注册
    @Insert("insert into tb_user(username,password,email) values(#{username},#{password},#{email})")
    public Integer userRegister(User user);

}
